package analyticsServer.observer;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * To change this template use File | Settings | File Templates.
 */
public abstract class Subject {

    private ArrayList<Observer> observers;

    public Subject(){
        observers = new ArrayList<Observer>();
    }

    public void add(Observer ob){
        observers.add(ob);
    }

    public void remove(Observer ob){
        observers.remove(ob);
    }

    public void notifyObservers(){
        for (Observer observer : observers) {
            observer.update();
        }
    }
}
